import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        String name="bbaabbaaaaa";
        String[] str=name.split("bbaa");
        System.out.println(str.length);
    }

    public static void main2(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int[] arr=new int[n];
        for (int i = 0; i < arr.length; i++) {
            arr[i]=sc.nextInt();
        }
        int count=0;
        for (int i=0;i<arr.length;i++){
            for(int j=i+1;j<arr.length;j++) {
                if (arr[i] > arr[j]) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }
    public static void main1(String[] args) {

        int m=0;
        for(m=1;m<=150;m++){
            if(m*(24.5/(150-m))==(32.0/m)*(150-m)){
                System.out.println(150-m);
                System.out.println(m);
                break;
            }
        }
    }

}
